<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <h1>docuidwia.com</h1>
    <h1>d后盾人</h1>
    <h1>dowimuucx.cn</h1>
  </body>
</html>

<script>
  let reg = /<(h[1-6])>([\s\S]+?)<\/\1>/gi;

  const body = document.body;

  const hd = body.innerHTML.matchAll(reg);
  let contnets = [];
  for (const iterator of hd) {
    contnets.push(iterator[2]);
  }
  console.table(contnets);
</script>
